A surface definition consists of a number of component keywords, each of which is usually followed by either a single number or a red-green-blue color triple. Each of the values in the color triple are normalized, with zero indicating zero intensity, and one indicating full intensity.
If any surface component is left unspecified, its value defaults to zero, with the exception of the index of refraction, which is assigned the default index of refraction (normally 1.0).
Surface descriptions are used in to compute the color of a ray that strikes the surface at a point P. The normal to the surface at P, N, is also computed.
A surface's ambient color is always applied to a ray. The color
applied is computed by multiplying the ambient color by the intensity
of the ambient light source.
If P is in shadow with respect to a given light source, that light source makes no contribution to the shading of P.
The diffuse contribution from each non-shadowed light source at P
is equal to the diffuse color of the surface scaled by the cosine of
the angle between N
and the vector from P to the light source.
The intensity of specular highlights from light sources are
scaled by the specular color of the surface.
The intensity of specularly reflected rays will be proportional to
the specular color of the surface scaled by the reflectivity.
The extinction coefficient is raised to a power equal to the distance
the transmitted ray travels through the object.
The overall intensity of specularly transmitted rays will be proportional to
this factor multiplied by the surface's body color
multiplied by the transparency of the object.
If a light source illuminates a translucent surface from the side opposite
that from which a ray approaches, illumination computations are performed,
using the given color as the surface's diffuse color, and the given
exponent as the Phong highlight exponent. The resulting color is then
scaled by the surface's translucency.